package com.vchello.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.vchello.bean.feedback.Feedback;
import com.vchello.controller.BaseController;
import com.vchello.service.feekback.FeedbackService;

/**
 * 
 * @author power
 *
 */
@Controller
@RequestMapping(value = "/admin/feedback")
public class FeedbackAdminController extends BaseController {
	
	@Autowired
	private FeedbackService feedbackService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public String list(Model model, Page<Feedback> page, Feedback feedback){
		page = feedbackService.selectPage(page, new EntityWrapper<Feedback>(feedback));
		model.addAttribute("pages", page);
		return "admin/feedback/feedbackList";
		
	}
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	public String listAjax(Model model, Page<Feedback> page, Feedback feedback){
		page = feedbackService.selectPage(page, new EntityWrapper<Feedback>(feedback));
		model.addAttribute("pages", page);
		return "admin/feedback/query/feedbackQuery";
		
	}
}
